1. Field of the Invention
The present invention relates to a computer graphic process and, more particularly, to a method and apparatus for perspective-transforming a three-dimensional thing on a virtual two-dimensional screen.
2. Description of the Related Art
In a conventional technique, when a three-dimensional object (thing) is perspective-transformed on a virtual two-dimensional screen, points for specifying the thing are respectively calculated in accordance with ratios of distances between a point of view and the points to a distance between the point of view and the screen to perform perspective transformation.
However, since the distances between the point of view and the respective points for specifying the thing are different from each other, very large amounts of calculation for the distances are required by the CPU (Central Processing Unit) or another device of a computer. In other words, in an entertainment system such as a video game apparatus, the heavy load on the CPU or the like is a problem when high-speed processing for an object image which continuously changes is performed.
The present invention has been made in consideration of the above problem, relates to a computer graphic process, and has as its object to provide a novel method and apparatus for perspective-transforming a three-dimensional thing on a virtual two-dimensional screen.
An apparatus for perspective-transforming a thing placed in a three-dimensional space according to the present invention has means in which, when the coordinate values of a plurality of points for specifying the thing are localized with respect to a certain direction in the three-dimensional space, by using the coordinate values of a typical point selected from the plurality of points, perspective transformation of the other points is approximated, and calculation for graphics is performed at a high speed.
When a plurality of things are localized in a three-dimensional space, approximation is performed in units of things.
The direction of a line of sight extending from a point of view to the thing is frequently used. For example, this direction of the line of sight is a Z-axis direction in an XYZ coordinate system specified around the point of view.
As the plurality of points, vertex coordinates obtained when a thing is drawn with polygons are frequently used.
The typical point is determined by a replacing method on the basis of the coordinate values of the plurality of points. For example, as the typical point, an average value of Z values, the Z value of the first selected point, or a point selected last can be set.
The coordinate values can also be calculated by a linear approximation, a quadratic approximation, or a higher-order approximation.
In this case, whether the coordinate values of a plurality of points for specifying the thing are localized with respect to a certain direction in the three-dimensional space or not is determined in the following manner. That is, it is assumed that the minimum value of the Z values of the thing in the Z-axis direction is represented by minZ, that the maximum value of the Z values of the thing is represented by maxZ, and that the average value of the Z values of the thing is represented by meanZ. In this case, when expressions:
|minZxe2x88x92maxZ|÷|minZ|xc2x7K1,
|minZxe2x88x92maxZ|÷|maxZ|xc2x7K1, or
|minZxe2x88x92maxZ|÷|meanZ|xc2x7K1
are satisfied, it is determined that the Z values of the thing are localized. The value of K1 is, e.g., 0.1.
However, the value of K1 may be changed depending on an application program to be applied, a scene to be applied, and the like.
In addition, whether the coordinate values of the plurality of points for specifying a plurality of things are localized with respect to a certain direction in the three-dimensional space in units of things or not is determined in the following manner. That is, it is assumed that the minimum value of the Z values of the ith thing (i=1, 2, . . . , M) in the Z-axis direction is represented by minZi, that the maximum value of the Z values of the ith thing is represented by maxZi, and that the average value of the Z values of the ith thing is represented by meanZi. In this case, when expressions:
|minZ1xe2x88x92maxZ1|÷|meanZ1xe2x88x92meanZ2|xc2x7K2,
|minZ2xe2x88x92maxZ2|÷|meanZ1xe2x88x92meanZ2|xc2x7K2,
|minZ2xe2x88x92maxZ2|÷|meanZ2xe2x88x92meanZ3|xc2x7K2,
|minZ3xe2x88x92maxZ3|÷|meanZ2xe2x88x92meanZ3|xc2x7K2,
|minZMxe2x88x921xe2x88x92maxZMxe2x88x921xe2x88x92|÷|meanZMxe2x88x921xe2x88x92meanZM|xc2x7K2, and
|minZMxe2x88x92maxZM|÷|meanZMxe2x88x921xe2x88x92meanZM|xc2x7K2,
are satisfied, it is determined that the Z values are localized in units of things. In this case, approximate calculations are performed in units of things. The value of K2 is, e.g., 0.1.
However, the value of K2 may be changed depending on an application program to be applied, a scene to be applied, and the like. The method may be selectively applied to only a thing in which the expressions are satisfied.
In addition, an apparatus for perspective-transforming a thing placed in a three-dimensional space on a virtual two-dimensional screen has means in which, when the coordinate values of a plurality of points for specifying things on the same scene are localized with respect to a certain direction in units of things, by using the coordinate values of a typical point selected for the respective things, perspective transformation of the other points for specifying the things is approximated.
The typical points may be selected by a replacing method, a linear approximation, a quadratic approximation, or a higher-order approximation.
In addition, an entertainment system according to the present invention including a control system, a graphic system, a sound system, an optical disk control unit, and a bus for connecting these systems and the unit to each other, and wherein the graphic system has a geometry transfer engine, and when the coordinate values of a plurality of points for specifying the thing are localized with respect to a certain direction in the three-dimensional space, by using the coordinate values of a typical point selected from the plurality of points, the graphic system approximates perspective transformation of the other points.
Here, when a plurality of things exist, and when the things are localized in units of things, approximation is performed in units of things.
In addition, a method of perspective-transforming a thing placed in a three-dimensional space according to the present invention includes the steps of: checking whether the coordinate values of a plurality of points for specifying the thing are localized with respect to a certain direction in the three-dimensional space or not; and, if the coordinate values are localized, approximating perspective transformation of the other points by using the coordinate values of a typical point selected from the plurality of points.
Here, when a plurality of things exist, and when the things are localized in units of things, approximation is performed in units of things.
In this manner, when the plurality of points are perspective-transformed, the Z values of several points can be arithmetically operated with approximate values. For this reason, a load on a CPU and other arithmetic operation means is reduced, and a high-speed perspective transformation can be achieved.